{include file="public/layout" /}

<body>
<link rel="stylesheet" href="__SKIN__/css/page.css" media="all">

<div class="layui-fluid" id="LAY-component-layer-list">
    <div class="layui-card">
        <div class="layui-card-body">
            <div class="layui-form layui-border-box layui-table-view house-table" lay-id="admin-arctype" >
                <div class="layui-table-box">
                    <div class="layui-table-body " >
                        <table cellspacing="0" cellpadding="0" border="0" class="layui-table layui-form" style="width: 100%" lay-skin="line">
                            <thead >
                            <tr>
                                <th class="w60 tc"> <div class="layui-table-cell w60 tc" ><span>ID</span></div></th>
                                <th class="wauto"> <div class="layui-table-cell wauto"><span>标题</span></div></th>
                                <th class="w100 tc"> <div class="layui-table-cell w100 tc"><span>所属栏目</span></div></th>
                                <th class="w110 tc"> <div class="layui-table-cell w110 tc"><span>更新时间</span></div></th>
                                <th class="w180 tc"> <div class="layui-table-cell w180 tc"><span>操作</span></div></th>
                            </tr>
                            </thead>
                            <tbody>
                            {empty name="list"}
                            <tr>
                                <td class="no-data" align="center" axis="col0" colspan="50">
                                    <i class="fa fa-exclamation-circle"></i>没有符合条件的数据
                                </td>
                            </tr>
                            {else /}
                            {foreach name="list" item="vo" key="k" }
                            <tr>
                                <td><div class="layui-table-cell w60 tc"> {$vo.id} </div></td>
                                <td>
                                    <div class="layui-table-cell wauto" title=" ">
                                        {eq name="'Arctype@edit'|is_check_access" value="1"}
                                        <a href="javascript:void(0);" data-url="{:url('Arctype/single_edit',array('typeid'=>$vo['id']))}" class="eju-event" data-type="single_edit">{$vo.typename}</a>
                                        {else /}
                                        {$vo.typename}
                                        {/eq}
                                    </div>
                                </td>
                                <td>
                                    <div class="layui-table-cell w100 tc">
                                        {$vo.typename|default='<i class="red">数据出错！</i>'}
                                    </div>
                                </td>
                                <td><div class="layui-table-cell w110 tc">  {$vo.update_time|date='Y-m-d',###} </div></td>
                                <td>
                                    <div class="layui-table-cell w180 tc right-oper">
                                        {eq name="'Arctype@edit'|is_check_access" value="1"}
                                        <a data-url="{:url('Arctype/single_edit',array('typeid'=>$vo['id']))}" class="layui-btn btn-edit" data-type="single_edit">
                                           编辑
                                        </a>
                                        {/eq}
                                        <a href="{$vo.arcurl}" target="_blank" class="layui-btn btn-primary" >
                                           浏览
                                        </a>
                                    </div>
                                </td>
                            </tr>
                            {/foreach}
                            {/empty}
                            </tbody>
                        </table>
                    </div>
                </div>
                <!--分页-->

            </div>
            {$pageStr}
        </div>
    </div>
</div>

<script>
    $(function () {
        /* 生成静态页面代码 */
        var typeid = "{$typeid}";
        if(typeid > 0){
            $.ajax({
                url:__root_dir__+"/index.php?m=home&c=Buildhtml&a=upHtml",
                type:'POST',
                dataType:'json',
                data:{'typeid':typeid,ctl_name:'Arctype',_ajax:1},
                success:function(data){

                }
            });
        }
    });
    layui.config({
        base: '__SKIN__/' //静态资源所在路径
        ,version: '{$version}'
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'table'], function(){
        var $ = layui.$
            ,form = layui.form
            ,table = layui.table;

        /* 触发事件 */
        var active = {
            single_edit: function(){
                var iframes = layer.open({
                    type: 2,
                    title: '编辑文档',
                    fixed: true, //不固定
                    shadeClose: false,
                    shade: 0.3,
                    content: $(this).data('url')
                });
                layer.full(iframes);
            }
        };

        $('#LAY-component-layer-list .layui-btn,.eju-event').on('click', function(){
            var type = $(this).data('type');
            active[type] && active[type].call(this);
        });
    });

</script>
{include file="public/footer" /}
